package mrusanov.staff

import java.util.Date
import mrusanov.player.Talent
import mrusanov.bonus.InjureTimeDecreaseBonus
import mrusanov.buildings.Hospital
import mrusanov.team.Club

class Doctor(name: String, birthDay: Date, exp: Int, talent: Talent) extends ClubEmployee(name, birthDay, exp, talent) {
	def injureTimeDecreaseBonus(hospital: Hospital) = InjureTimeDecreaseBonus(this, hospital.usageLevel)
	override def isClubInfrastructureGoodEnough(club: Club): Boolean = {
		val bonusWithCurrentLevel = InjureTimeDecreaseBonus(this, club.buildings.hospital.buildingLevel)
		val bonusWithNextLevel = InjureTimeDecreaseBonus(this, club.buildings.hospital.buildingLevel + 1)
		// if bonuses are the same this means that club facility is good enough
		bonusWithCurrentLevel == bonusWithNextLevel
	}

	override def addToClubStaff(club: Club) {
		require(canBeAddedToClubStaff(club))
		club.clubStaff.doctor = Some(this)
	}

	override def canBeAddedToClubStaff(club: Club) = club.clubStaff.doctor.isEmpty

}
